package au.edu.swin.bank.ejb.session.stateless;

import au.edu.swin.bank.persistence.entity.Account;
import au.edu.swin.bank.persistence.entity.BankTransactionDTO;
import java.math.BigInteger;
import java.util.Collection;
import javax.ejb.Local;

/**
 *
 * @author scott
 */
@Local
public interface AccountLocal
{
    /**
     * Retrieves an account with the specified ID.
     * @param accountId The ID of the account to retrieve
     * @return The Account object
     */
    public Account getAccount(BigInteger accountId);

    /**
     * Performs a withdrawal of a specified amount on a specified account.
     * @param amount The amount to withdraw
     * @param account The account to withdraw from
     * @return True if success, otherwise false
     */
    public boolean withdraw(double amount, Account account);

    /**
     * Performs a deposit of a specified amount on a specified account.
     * @param amount The amount to deposit
     * @param account The account to deposit into
     * @return Returns true once the deposit has been processed
     */
    public boolean deposit(double amount, Account account);


    /**
     * Gets a list of transactions for the specified account between the specified dates
     * @param aAccount The account to get the transactions for
     * @param aStartDate The start date of the transaction period
     * @param aEndDate The end date of the transaction period
     * @return A collection of transactions
     */
    public Collection<BankTransactionDTO> getTransactions(Account aAccount, BigInteger aStartDate, BigInteger aEndDate);

    /**
     * Forces an eviction of the data in the Bean's cache.
     */
    public void forceEvict();
}
